<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>用户组管理信息</title>
		<link rel="stylesheet" type="text/css"
			href="${pageContext.request.contextPath}/css/public.css">
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/js/sorttable.js"></script>
		<script language="JavaScript"
			src="${pageContext.request.contextPath}/js/public.js"></script>
		<script  language="JavaScript"
			src="${pageContext.request.contextPath}/js/validate.js"></script>
		<script type="text/javascript">
	  	function validate(){	
			var rolename = document.getElementById("rolename");
			var roledesc = document.getElementById("roledesc");
			
					
			if(!isNotNull(rolename,'用户组名')||!f_check_ZhOrNumOrLett(rolename,'用户组名')||!f_check_stringLength(rolename,'用户组名',12))
				return false ;	
			
			if(!(isNotNull(roledesc,'说明')&&f_check_ZhOrNumOrLett(roledesc,'说明')&&f_check_stringLength(roledesc,'说明',12)))
				return false ;	
				
			var left=document.forms[0].leftUser;
			if(left.length==0){
			alert("至少添加一个用户至该用户组");
			return false;
			}
			
 			for(i=0; i <left.length; i++){
  				left[i].selected = true;
  			}	
		} 
		</script>
	</head>
	<body>

		<div id="info_all" style="width:400px;">
			<div id="info_top">
				用户组修改
			</div>
				<div  style="width:380px;margin-top:0px;" >
				<s:form action="editUserGroup" onsubmit="return validate()">
				<input type="hidden" name="editedUserRole.roleId"  size="12" value="${editedUserRole.roleId}"/>
					<table style="width:380px;margin-top:10px;background:#fbfbfb;color:#403040;" align="center">
						<tr>
							<td>
								用户组名&nbsp;：
							</td>
							<td align="left">
								<input type="text" name="editedUserRole.roleName" id="rolename" size="12" value="${editedUserRole.roleName}"/>
							</td>
						</tr>
						<tr>
							<td>
								说 &nbsp; &nbsp;明：
							</td>
							<td align="left">
								<input type="text" name="editedUserRole.roleDesc" id="roledesc" size="12" value="${editedUserRole.roleDesc}" />
							</td>
						</tr>
								<s:optiontransferselect label="    添加用户 "  cssStyle="width:100px" doubleCssStyle="width:100px"
								name="leftUser"	leftTitle="隶属于该组" 
								list="#request.leftList" listKey="userId"
								listValue="userName" multiple="true"  
								emptyOption="false" allowUpDownOnLeft="false" 
								doubleName="rightUser" rightTitle="不隶属于该组"  
								doubleList="#request.rightList" doubleListKey="userId" 
								doubleListValue="userName" doubleMultiple="true"
				 				doubleEmptyOption="false" allowUpDownOnRight="false" 
				 				addToLeftLabel="向左移动" addToRightLabel="向右移动"
     							addAllToLeftLabel="全部左移" addAllToRightLabel="全部右移"
     							selectAllLabel="全部选择" 
				 				/>		
						<tr>
							<td colspan="2" align="center">
								&nbsp;&nbsp;
								<input type="submit" value="保存" onFocus="this.blur()"
									onmouseover="this.className='btnover'"
									onmouseout="this.className='btnout'" class="btnsize" />
							&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
								<input type="button" value="返回" onFocus="this.blur()" onclick="history.go(-1)"
									onmouseover="this.className='btnover'"
									onmouseout="this.className='btnout'" class="btnsize" />

							</td>
						</tr>
					</table>
							</s:form>
				</div>
		

		</div>

	</body>
</html>